GlobalBase exposes standard variables and methods to all script code.


Properties


CurrentInputType

UserInputType CurrentInputType

Get current Input Type


Methods


AbortGame

static void AbortGame(string message)

Exits the game with an error message.


ApplyGraphicalChanges

static void ApplyGraphicalChanges()

Apply graphical changes within the engine.


AreThingsOverlapping

Determines whether two objects or characters are overlapping each other.


CallRoomScript

static void CallRoomScript(int value)

Calls the on_call function in the current room.


ClaimEvent

static void ClaimEvent()

Prevents further event handlers running for this event.


CyclePalette

Cycles the palette entries between start and end. (8-bit games only)


Debug

Performs various debugging commands.


DeleteSaveSlot

static void DeleteSaveSlot(int slot)

Deletes the specified save game.


DisableGroundLevelAreas

Disables all region events, and optionally light levels and tints.


DisableInterface

static void DisableInterface()

Disables the player interface and activates the Wait cursor.


Display

static void Display(string message, Object[] args)

Displays the text in a standard text window.


DisplayAt

Displays the text in a standard text window at the specified location.


DisplayAtY

Displays the text in a standard text window at the specified y-coordinate.


DisplayMessage

Displays a message from the Room Message Editor.


DisplayMessageAtY

Displays a message from the Room Message Editor at the specified y-coordinate.


DisplayMessageBar

Displays a Room Message Editor message in a text window with a title, used for speech in SCI0 games.


DisplayTopBar

Displays a message in a text window with a title, used for speech in SCI0 games.


DoubleToInt

static int DoubleToInt(Double value, RoundDirection roundDirection)

Converts a floating point value to an integer.


EnableGroundLevelAreas

Re-enables region events, light levels and tints.


EnableInterface

static void EnableInterface()

Re-enables the player interface.


EndCutscene

static int EndCutscene()

Specifies the end of a skippable cutscene.


FadeIn

static void FadeIn(int no)

Fades the screen in from black to the normal palette.


FadeOut

static void FadeOut(int no)

Fades the screen out to the current fade colour.


FlipScreen

Flip Screen


FloatToInt

static int FloatToInt(Single value, RoundDirection roundDirection)

Converts a floating point value to an integer.


GetBackgroundFrame

static int GetBackgroundFrame()

Gets the current background frame number.


GetBinaryProperty

static int GetBinaryProperty(string property)

Gets a binary integer Custom Property associated with the current room (0 or 1).


GetBoolProperty

static bool GetBoolProperty(string property)

Gets a bool Custom Property associated with the current room.


GetCurrentMusic

Returns the number of the currently playing background music, or -1 if no music is playing.


GetDisplayStyle

static DisplayStyle GetDisplayStyle()

Get the current DisplayStyle.


GetFontHeight

static int GetFontHeight(int font)

Returns the given font's height, in pixels. This value may be used, for example, to calculate arrangement of text and GUI elements on screen.


GetFontLineSpacing

static int GetFontLineSpacing(int font)

Returns the step between two lines of text for the specified font. If this value equals font's height, then each next line is rendered right after previous one with no space in between. If the line spacing is lower than font's height, then the lines of text are partially overlapping.


GetFullScreen

static bool GetFullScreen()

Get flag to indicate whether display is full screen or not.


GetGameOption

Gets the current value of a game option.


GetGamePadState

static GamePadState GetGamePadState()

Get current GamePadState for use in game script.


GetGameSpeed

static int GetGameSpeed()

Gets the current game speed.


GetGlobalInt

static int GetGlobalInt(int globalInt)

Get Global Integer


GetGraphicalVariable

Get graphical variable


GetIntegerProperty

static LooseInteger GetIntegerProperty(string property)

Gets an integer Custom Property associated with the current room.


GetLocationType

static LocationType GetLocationType(int x, int y)

Gets what type of thing is in the room at the specified co-ordinates.


GetMP3PosMillis

Get position of given MP3.


GetRoomProperty

static LooseInteger GetRoomProperty(string property)

Gets an integer Custom Property associated with the current room.


GetScalingAt

static int GetScalingAt(int x, int y)

Returns the scaling level at the specified position within the room.


GetTextHeight

static int GetTextHeight(string text, FontType fontType, int width)

Gets the height of the specified text in the specified font when wrapped at the specified width


GetTextProperty

static string GetTextProperty(string property)

Gets a string Custom Property associated with the current room.


GetTextWidth

static int GetTextWidth(string text, FontType fontType)

Gets the width of the specified text in the specified font


GetTranslation

Gets the translated version of the specified text.


GetViewportX

static int GetViewportX()

Gets the current X offset of the scrolled viewport.


GetViewportY

static int GetViewportY()

Gets the current Y offset of the scrolled viewport.


GetWalkableAreaAt

static int GetWalkableAreaAt(int screenX, int screenY)

Returns which walkable area is at the specified position relative to the current viewport (same as GetWalkableAreaAtScreen).


GetWalkableAreaAtRoom

static int GetWalkableAreaAtRoom(int roomX, int roomY)

Returns the ID of the walkable area at room co-ordinates (X, Y). If there is no walkable area there, or if invalid co-ordinates are specified, returns 0.


GetWalkableAreaAtScreen

static int GetWalkableAreaAtScreen(int screenX, int screenY)

Returns which walkable area is at the specified position relative to the current viewport.


GiveScore

Adds to the player's score and plays the score sound, if set.


GotoPreviousDialog

static void GotoPreviousDialog()

Goto Previous Dialog


HasPlayerBeenInRoom

Checks whether the player has been in the specified room yet.


IntToFloat

static float IntToFloat(int value)

Converts an integer to a floating point number.


IsButtonDown

static LooseInteger IsButtonDown(Buttons button)

Checks whether the specified gamepad controller button is currently down.


IsChannelPlaying

Returns 1 if sound channel number CHANNEL is currently playing sound. If the specified channel is not currently playing anything, returns 0.


IsGamePaused

static LooseInteger IsGamePaused()

Is Game Paused?


IsInteractionAvailable

Checks whether an event handler is registered to handle clicking at the specified location on the screen.


IsInterfaceEnabled

static LooseInteger IsInterfaceEnabled()

Checks whether the player interface is currently enabled.


IsKeyPressed

static LooseInteger IsKeyPressed(eKeyCode eKeyCode)

Checks whether the specified key is currently held down.


IsMusicVoxAvailable

Checks whether a MUSIC.VOX file was found.


IsSpeechVoxAvailable

Is VOX Available? (same as IsVoxAvailable)


IsTimerExpired

static LooseInteger IsTimerExpired(int timerID)

Returns true the first time this is called after the timer expires.


IsTranslationAvailable

Checks if a translation is currently in use.


IsVoxAvailable

Is VOX Available?


PauseGame

static void PauseGame()

Pauses the game, which stops all animations and movement.


PlayAmbientSound

static void PlayAmbientSound(int one, int two, int three, int four, int five)

Play Ambient Sound


PlayFlic

Plays a FLI/FLC animation.


PlayMusic

static void PlayMusic(int i)

Play Music given integer ID.


PlaySound

static void PlaySound(int soundNo)

Play sounds based on integer ID.


PlaySoundEx

Plays sound effect on given channel number.


PlayVideo

static void PlayVideo(string filename, VideoSkipStyle videoSkipStyle, int flags)

Plays an Ogg Theora video.


ProcessClick

static void ProcessClick(int x, int y, CursorMode cursorMode)  
static void ProcessClick(int x, int y, int cursorModeInt)


QuitGame

static void QuitGame(int promptUser)

Quits the game, optionally showing a confirmation dialog.


Random

static int Random(int max)

Generate random number up to given maximum.


ReleaseViewport

static void ReleaseViewport()

Allows engine to scroll the screen automatically to follow the player character.


RemoveWalkableArea

static void RemoveWalkableArea(int area)

Removes the specified walkable area from the room.


ResetRoom

Resets the room state back to how it was initially set up in the editor.


RestartGame

static void RestartGame()

Restart Game.


RestoreGameDialog

Displays the default built-in Restore Game dialog.


RestoreGameSlot

static void RestoreGameSlot(int slot)

Restores the game saved to the specified game slot.


RestoreWalkableArea

static void RestoreWalkableArea(int area)

Brings back a previously removed walkable area.


SaveGameDialog

Displays the default built-in Save Game dialog.


SaveGameSlot

static void SaveGameSlot(int slot, string description)

Saves the current game position to the specified slot.


SaveScreenShot

static int SaveScreenShot(string filename)

Saves a screenshot of the current game position to a file.


SeekMP3PosMillis

static void SeekMP3PosMillis(int position)

Move to MP3 position


SetAmbientLightLevel

Sets the ambient light level.


SetAmbientTint

Sets an ambient tint that affects all objects and characters in the room.


SetAreaScaling

Changes the specified walkable area's scaling level.


SetBackgroundFrame

static void SetBackgroundFrame(int frameNo)

Set background frame based on integer ID.


SetChannelVolume

Changes the volume of a given sound channel.


SetDigitalMasterVolume

Sets the overall digital sound volume, from 0-100.


SetDisplayStyle

static void SetDisplayStyle(DisplayStyle displayStyle)

Set the current DisplayStyle.


SetFadeColor

Changes the colour to which the screen fades out with a FadeOut call.


SetFullScreen

static void SetFullScreen(bool fullScreen)

Set flag for full screen or windowed display.


SetGameOption

Changes a game option; see the manual for details.


SetGameSpeed

static void SetGameSpeed(int framesPerSecond)

Changes the current game speed.


SetGlobalInt

static void SetGlobalInt(int globalInt, int value)

Set Global Integer


SetGraphicalVariable

Set graphical variable


SetMultitaskingMode

Sets whether the game can continue to run in the background if the player switches to another application.


SetMusicMasterVolume

static void SetMusicMasterVolume(int volume)

Set Master volume for music.


SetMusicRepeat

Set number of times for music to repeat.


SetMusicVolume

Set volume of currently playing music.


SetNextScreenTransition

static void SetNextScreenTransition(TransitionStyle transitionStyle)

Changes the room transition style for the next room change only.


SetPalRGB

Changes the RGB colour of a palette slot. (8-bit games only)


SetRestartPoint

Sets this as the point at which the game will be restarted.


SetScreenTransition

static void SetScreenTransition(TransitionStyle transitionStyle)

Changes the room transition style.


SetSkipSpeech

Sets how the player can skip speech lines.


SetSoundVolume

static void SetSoundVolume(int volume)

Set volume for sounds.


SetSpeechStyle

Changes the style in which speech is displayed.


SetSpeechVolume

Changes the voice speech volume.


SetTextWindowGUI

Changes the GUI used to render standard game text windows.


SetTimer

static void SetTimer(int timerID, int timeout)

Starts a timer, which will expire after the specified number of game loops.


SetViewport

static void SetViewport(int x, int y)

Locks the viewport to stop the screen scrolling automatically.


SetVoiceMode

Sets whether voice and/or text are used in the game.


SetWalkBehindBase

static void SetWalkBehindBase(int area, int baseline)

Changes the baseline of the specified walk-behind area.


ShakeScreen

static void ShakeScreen(int amount)

Shakes the screen by the specified amount.


ShakeScreenBackground

static void ShakeScreenBackground(int delay, int amount, int length)

Shakes the screen but does not pause the game while it does so.


SkipUntilCharacterStops

Fast-forwards the game until the specified character finishes moving.


StartCutscene

static void StartCutscene(CutsceneSkipType cutSceneSkipType)

Specifies the start of a skippable cutscene.


StopAmbientSound

Stops the currently playing ambient sound on the specified channel.


StopChannel

Stops the currently playing sound on given channel number.


StopDialog

static void StopDialog()

From within dialog_request, tells engine not to return to the dialog after this function ends.


StopMusic

Stop currently playing music.


StringFormatAGS

static string StringFormatAGS(string str, Object[] args)

Format String AGS Style


TintScreen

Tints the whole screen to the specified colour.


UnPauseGame

static void UnPauseGame()

Resumes the game after it was paused earlier.


UpdateInventory

Refreshes the on-screen inventory display.


UpdatePalette

Updates the screen with manual changes to the palette. (8-bit games only)


Wait

static void Wait(int length)

Wait based on number of frames


WaitKey

Blocks the script for the specified number of game loops, unless a key is pressed.


WaitMouseKey

static int WaitMouseKey(int waitLoops)

Blocks the script for the specified number of game loops, unless a key is pressed or the mouse is clicked.